-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulling fix/default-font-2 into develop #977
Conversation
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #977 +/- ##
========================================
Coverage 90.12% 90.13%
========================================
Files 313 313
Lines 18810 18828 +18
Branches 791 797 +6
========================================
+ Hits 16953 16971 +18
- Misses 1854 1856 +2
+ Partials 3 1 -2
|
99d8ec4
to
8bd04f7
Compare
b350ec5
to
c5827d1
Compare
Adds "Inter Variable" as a default font option in the FontFamilyDropdown component and updates the FontFamily enum to include INTER_VARIABLE. This allows users to select the Inter Variable font in the editor.
The default font family is now Inter Variable, which improves the default look and feel of the editor.
The editor now initializes with an empty text node to ensure consistent behavior and prevent potential errors when the editor starts without any content.
This commit introduces the DictybaseToolbar component, which provides a toolbar for the editor with various formatting options. It includes buttons for undo, redo, font size, font family, block format, bold, italic, underline, color picker, insert link, insert table, insert image, and upload file. The toolbar utilizes Material-UI components and custom hooks for styling and cleanup.
This commit introduces a new package, editor-toolbar, which exports the DictybaseToolbar component and atomConfigs context. This toolbar will be used in the editor for dictyBase.
Adds a font selection dropdown to the editor toolbar, allowing users to change the font of selected text. The font selection dropdown is populated with a list of available fonts, defined in the `fonts` array. The `DEFAULT_FONT` constant is used to set the initial font of the editor. The `formatAtom` is updated to include a `fontFamily` property, which is used to store the currently selected font. The `isBoldAtom`, `isItalicAtom`, `isUnderlinedAtom`, `fontSizeAtom`, `fontColorAtom`, and `blockTypeAtom` atoms are updated to use the `focusAtom` function to derive their values from the `formatAtom`. The `tableActionMenuOpenAtom` and `colorPickerOpenAtom` atoms are updated to use the `focusAtom` function to derive their values from the `openAtom`. This change allows users to customize the appearance of their text by selecting a different font.
The main entrypoint was pointing to a .tsx file, but it should point to the compiled .ts file. This change fixes the entrypoint to point to the correct file.
The initial editor state was hardcoded to use "Inter Variable" as the font family. This commit changes the initial state to use the DEFAULT_FONT variable from the "@dictybase/editor-toolbar" package. This ensures that the editor always uses the correct default font, even if the DEFAULT_FONT variable is changed in the future.
The FontFamilyDropdown component now uses the fonts atom to populate the dropdown options. This change centralizes the font options in a single location, making it easier to manage and update. The defaultFontFamilyOptions property has been removed as it is no longer needed.
… bottom The Inter Variable font was moved to the bottom of the font list. This change improves the user experience by prioritizing more common fonts.
Use fp-ts Option to safely handle the initial editor state. This avoids potential errors when accessing nested properties of the content object. The code now uses `pipe` and Option methods like `fromNullable`, `map`, and `getOrElse` to handle cases where `content` or `content.editorState` might be null or undefined. This makes the code more robust and easier to reason about.
The default font-family was hardcoded to "Arial". This commit changes the default value to DEFAULT_FONT, which is defined in atomConfigs. This ensures that the default font-family is consistent throughout the application.
The title attribute was added to the Select component to improve accessibility. This provides a descriptive label for screen readers and other assistive technologies, making the component more user-friendly for individuals with disabilities.
The event.target.value type was string, but it should be FontFamily. This change ensures that the correct type is used.
…unused code The toolbar is now conditionally rendered based on the `toolbar` and `editable` props. The `fp-ts` library is used to handle the nullable `toolbar` prop and the boolean `editable` prop. Unnecessary commented-out code and styles were removed to improve code readability.
The editor now renders an empty fragment instead of nothing when both the toolbar and editable props are null. This ensures that the editor always renders something, even if it's just an empty fragment.
The ButtonStates type definition was duplicated across multiple packages. This type definition was not being used.
The change encapsulates internal atom configurations by making enums and atoms private, and selectively exports only the necessary atoms for external use. This improves modularity and prevents unintended modifications to the internal state.
The export of the atoms was moved to the bottom of the file to improve readability.
This change adds a new class `iconButton` to the `AuthorizedHeading` component in `ui-dsc`. The new class removes the padding from the top and bottom of the icon button. This change improves the appearance of the component by making the icon button look more visually appealing.
fcea41f
to
f6af4c5
Compare
… FontSizes array This commit introduces a DEFAULT_FONT_SIZE constant and removes the FontSizes array. The default font size is now defined as a constant, which improves code readability and maintainability. The FontSizes array was removed because it was not being used and was redundant.
…return objects with value and label The font size array generation was refactored to return an array of objects, each with a `value` and a `label` property. This improves the readability and maintainability of the code, as it makes it clearer what each value in the array represents. It also makes it easier to use the array in the `MenuItem` components, as the `value` and `label` properties can be directly accessed.
The editor now has a default font size in its initial state. This ensures that the editor always starts with a consistent font size, improving the user experience.
This commit improves the font size dropdown component by adding a space between the font size value and the "px" unit in the label. It also cleans up the atom configs by removing an unnecessary empty line.
No description provided.